Light Sensor
A sensor that measures strength and polarity of magnetic field.
import { LightLevel } from "@devicescript/core"
const lightLevel = new LightLevel()
Registers
reading
Detect light level
- read only
import { LightLevel } from "@devicescript/core"
const lightLevel = new LightLevel()
const value = await lightLevel.reading.read()
- track incoming values
import { LightLevel } from "@devicescript/core"
const lightLevel = new LightLevel()
// ...
lightLevel.reading.subscribe(async (value) => {
...
})
readingError
Absolute estimated error of the reading value
- read only
import { LightLevel } from "@devicescript/core"
const lightLevel = new LightLevel()
const value = await lightLevel.readingError.read()
- track incoming values
import { LightLevel } from "@devicescript/core"
const lightLevel = new LightLevel()
lightLevel.readingError.subscribe(async (value) => {
...
})
variant
The type of physical sensor.
- read only
import { LightLevel } from "@devicescript/core"
const lightLevel = new LightLevel()
const value = await lightLevel.variant.read()